/*
    ByteBuffer.h - Abstraction of a generic buffer
    License: BSD
*/
#ifndef BYTEBUFFER_H_INCLUDED
#define	BYTEBUFFER_H_INCLUDED

#include <vector>

class ByteBuffer {
public:
    ByteBuffer ( );
    void         resize     ( unsigned int size );
    int          set        ( char* buffer, unsigned int length );
    unsigned int length     ( ) const;
    char*        operator[] ( int idx );
    const char*  operator[] ( int idx ) const;
    void         rewind     ( );
    unsigned int read       ( void* dst, unsigned int count );    
    
private:
    unsigned int      m_read_ptr;
    std::vector<char> m_bytes;
    
};

#endif	/* BYTEBUFFER_H */

